home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 15 / develop 15 code / 3D Interface / Library / Icons.h next >
Encoding:
C/C++ Source or Header  |  1993-06-02  |  6.7 KB  |  247 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Icons.h
  3.  
  4.     Contains:    Public C Interfaces for color icon plotting routines
  5.  
  6.     Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  7.  
  8.     NOTE!  Use this file only if you don't have the latest version of Icons.h
  9.         that has all of the icon suite functions.
  10. */
  11.  
  12. #ifndef __ICONS__
  13. #define __ICONS__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __QUICKDRAW__
  20. #include <QuickDraw.h>
  21. #endif
  22.  
  23. #define noMaskFound            -1000
  24. #define haltIterator        -1001
  25.  
  26. #define Large1BitMask    'ICN#'
  27. #define Large4BitData    'icl4'
  28. #define Large8BitData    'icl8'
  29. #define Small1BitMask    'ics#'
  30. #define Small4BitData    'ics4'
  31. #define Small8BitData    'ics8'
  32. #define Mini1BitMask    'icm#'
  33. #define Mini4BitData    'icm4'
  34. #define Mini8BitData    'icm8'
  35.  
  36.  
  37. /*  Selector mask values  */
  38. typedef unsigned long    IconSelectorValue;    
  39. #define svLarge1Bit            0x00000001
  40. #define svLarge4Bit            0x00000002
  41. #define svLarge8Bit            0x00000004
  42. #define svSmall1Bit            0x00000100
  43. #define svSmall4Bit            0x00000200
  44. #define svSmall8Bit            0x00000400
  45. #define svMini1Bit            0x00010000
  46. #define svMini4Bit            0x00020000
  47. #define svMini8Bit            0x00040000
  48. #define svAllLargeData        0x000000ff
  49. #define svAllSmallData        0x0000ff00
  50. #define svAllMiniData        0x00ff0000
  51. #define svAll1BitData        (svLarge1Bit | svSmall1Bit | svMini1Bit)
  52. #define svAll4BitData        (svLarge4Bit | svSmall4Bit | svMini4Bit)
  53. #define svAll8BitData        (svLarge8Bit | svSmall8Bit | svMini8Bit)
  54. #define svAllAvailableData    0xffffffff
  55.  
  56.  
  57. /*  alignment type values  */
  58. typedef short    IconAlignmentType;    
  59. #define atNone                0x0
  60. #define atVerticalCenter    0x1
  61. #define atTop                0x2
  62. #define atBottom            0x3
  63. #define atHorizontalCenter    0x4
  64. #define atAbsoluteCenter    (atVerticalCenter | atHorizontalCenter)
  65. #define atCenterTop            (atTop | atHorizontalCenter)
  66. #define atCenterBottom        (atBottom | atHorizontalCenter)
  67. #define atLeft                0x8
  68. #define atCenterLeft        (atVerticalCenter | atLeft)
  69. #define atTopLeft            (atTop | atLeft)
  70. #define atBottomLeft        (atBottom | atLeft)
  71. #define atRight                0xC
  72. #define atCenterRight        (atVerticalCenter | atRight)
  73. #define atTopRight            (atTop | atRight)
  74. #define atBottomRight        (atBottom | atRight)
  75.  
  76.  
  77. /*  transform type values  */
  78. typedef short    IconTransformType;    
  79. #define    ttNone                0x0
  80. #define    ttDisabled            0x1
  81. #define    ttOffline            0x2
  82. #define ttOpen                0x3
  83. #define ttLabel1            0x0100
  84. #define ttLabel2            0x0200
  85. #define ttLabel3            0x0300
  86. #define ttLabel4            0x0400
  87. #define ttLabel5            0x0500
  88. #define ttLabel6            0x0600
  89. #define ttLabel7            0x0700
  90. #define    ttSelected            0x4000
  91. #define ttSelectedDisabled    (ttSelected | ttDisabled)
  92. #define    ttSelectedOffline    (ttSelected | ttOffline)
  93. #define ttSelectedOpen        (ttSelected | ttOpen)
  94.  
  95. typedef pascal OSErr (*IconAction)(ResType theType, Handle *theIcon, void *yourDataPtr);
  96. typedef pascal Handle (*IconGetter)(ResType theType, void *yourDataPtr);
  97.  
  98. #ifdef __cplusplus
  99. extern "C" {
  100. #endif
  101.  
  102. pascal OSErr PlotIconID(const Rect *theRect,
  103.                             IconAlignmentType align,
  104.                             IconTransformType transform,
  105.                             short theResID)
  106.     = {0x303C, 0x0500, 0xABC9};
  107.     
  108. pascal OSErr NewIconSuite(Handle *theIconSuite)
  109.     = {0x303C, 0x0207, 0xABC9};
  110.     
  111. pascal OSErr AddIconToSuite(Handle theIconData,
  112.                             Handle theSuite,
  113.                             ResType theType)
  114.     = {0x303C, 0x0608, 0xABC9};
  115.     
  116. pascal OSErr GetIconFromSuite(Handle *theIconData,
  117.                             Handle theSuite,
  118.                             ResType theType)
  119.     = {0x303C, 0x0609, 0xABC9};
  120.     
  121. pascal OSErr ForEachIconDo(Handle theSuite,
  122.                             IconSelectorValue selector,
  123.                             IconAction action,
  124.                             void *yourDataPtr)
  125.     = {0x303C, 0x080A, 0xABC9};
  126.     
  127. pascal OSErr GetIconSuite(Handle *theIconSuite,
  128.                             short theResID,
  129.                             IconSelectorValue selector)
  130.     = {0x303C, 0x0501, 0xABC9};
  131.     
  132. pascal OSErr DisposeIconSuite(Handle theIconSuite,
  133.                             Boolean disposeData)
  134.     = {0x303C, 0x0302, 0xABC9};
  135.     
  136. pascal OSErr PlotIconSuite(const Rect *theRect,
  137.                             IconAlignmentType align,
  138.                             IconTransformType transform,
  139.                             Handle theIconSuite)
  140.     = {0x303C, 0x0603, 0xABC9};
  141.     
  142. pascal OSErr MakeIconCache(Handle *theHandle,
  143.                             IconGetter makeIcon,
  144.                             void *yourDataPtr)
  145.     = {0x303C, 0x0604, 0xABC9};
  146.     
  147. pascal OSErr LoadIconCache(const Rect *theRect,
  148.                             IconAlignmentType align,
  149.                             IconTransformType transform,
  150.                             Handle theIconCache)
  151.     = {0x303C, 0x0606, 0xABC9};
  152.  
  153. pascal OSErr PlotIconMethod(const Rect *theRect,
  154.                             IconAlignmentType align,
  155.                             IconTransformType transform,
  156.                             IconGetter theMethod,
  157.                             void *yourDataPtr)
  158.     = {0x303C, 0x0805, 0xABC9};
  159.     
  160. pascal OSErr GetLabel(short labelNumber,
  161.                             RGBColor *labelColor,
  162.                             Str255 labelString)
  163.     = {0x303c, 0x050B, 0xABC9};
  164.     
  165. pascal Boolean PtInIconID(Point                testPt,
  166.                             Rect                *iconRect,
  167.                             IconAlignmentType    alignment,
  168.                             short                iconID)
  169.     = {0x303c, 0x060D, 0xABC9};
  170.     
  171. pascal Boolean PtInIconSuite(Point            testPt,
  172.                             Rect                *iconRect,
  173.                             IconAlignmentType    alignment,
  174.                             Handle                 theIconSuite)
  175.     = {0x303c, 0x070E, 0xABC9};
  176.     
  177. pascal Boolean PtInIconMethod(Point            testPt,
  178.                             Rect                *iconRect,
  179.                             IconAlignmentType    alignment,
  180.                             IconGetter             theMethod,
  181.                             void                 *yourDataPtr)
  182.     = {0x303c, 0x090F, 0xABC9};
  183.     
  184. pascal Boolean RectInIconID(Rect                *testRect,
  185.                             Rect                *iconRect,
  186.                             IconAlignmentType    alignment,
  187.                             short                iconID)
  188.     = {0x303c, 0x0610, 0xABC9};
  189.     
  190. pascal Boolean RectInIconSuite(Rect            *testRect,
  191.                             Rect                *iconRect,
  192.                             IconAlignmentType    alignment,
  193.                             Handle                 theIconSuite)
  194.     = {0x303c, 0x0711, 0xABC9};
  195.     
  196. pascal Boolean RectInIconMethod(Rect            *testRect,
  197.                             Rect                *iconRect,
  198.                             IconAlignmentType    alignment,
  199.                             IconGetter             theMethod,
  200.                             void                 *yourDataPtr)
  201.     = {0x303c, 0x0912, 0xABC9};
  202.     
  203. pascal OSErr IconIDToRgn(RgnHandle theRgn,
  204.                             Rect                *iconRect,
  205.                             IconAlignmentType    alignment,
  206.                             short                iconID)
  207.     = {0x303c, 0x0613, 0xABC9};
  208.     
  209. pascal OSErr IconSuiteToRgn(RgnHandle theRgn,
  210.                             Rect                *iconRect,
  211.                             IconAlignmentType    alignment,
  212.                             Handle                 theIconSuite)
  213.     = {0x303c, 0x0714, 0xABC9};
  214.     
  215. pascal OSErr IconMethodToRgn(RgnHandle theRgn,
  216.                             Rect                *iconRect,
  217.                             IconAlignmentType    alignment,
  218.                             IconGetter             theMethod,
  219.                             void                 *yourDataPtr)
  220.     = {0x303c, 0x0915, 0xABC9};
  221.     
  222. pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
  223.     = {0x303C, 0x0316, 0xABC9};
  224.  
  225. pascal short GetSuiteLabel(Handle theSuite)
  226.     = {0x303C, 0x0217, 0xABC9};
  227.  
  228. pascal void SetIconDevice(GDHandle theScreen)
  229.     = {0x303C, 0x0218, 0xABC9};
  230.         
  231. pascal OSErr GetIconCacheData(Handle theCache, void **theData)
  232.     = {0x303C, 0x0419, 0xABC9};
  233.         
  234. pascal OSErr SetIconCacheData(Handle theCache, void *theData)
  235.     = {0x303C, 0x041A, 0xABC9};
  236.         
  237. pascal OSErr GetIconCacheProc(Handle theCache, IconGetter *theProc)
  238.     = {0x303C, 0x041B, 0xABC9};
  239.         
  240. pascal OSErr SetIconCacheProc(Handle theCache, IconGetter theProc)
  241.     = {0x303C, 0x041C, 0xABC9};
  242.     
  243. #ifdef __cplusplus
  244. }
  245. #endif
  246.  
  247. #endif